package org.numb.concurrency.chapter02;

public class MyRunnable implements Runnable{
    @Override
    public void run() {
        int i = 0;
        while(i < 100) {
            System.out.println("Thread running: " + i++);
        }
    }

    public static void main(String[] args) {
        // 创建实现了Runnable的对象
        MyRunnable runnable = new MyRunnable();
        // 根据Runnable的对象创建Thread，thread.start()后会执行runnable.run()方法，
        Thread thread = new Thread(runnable);
        thread.start();
    }
}
